concat:[s1:[Dynamic] * s2:[Dynamic] -> [Dynamic]] <- 
	match s1 with 
		head::tail	=> head :: (concat tail s2)
	|	else 		=> s2
	/match;

length:[lst:[Dynamic] -> Int] <- 
	match lst with
		head::tail	=> 1 + (length tail)
	|	else		=> 0
	/match;

sublist:[lst:[Dynamic] * start:Int * stop:Int -> [Dynamic]] <-
	subh:[lst:[Dynamic] * start:Int * stop:Int * ctr:Int -> [Dynamic]] :=
		match lst with
			head::tail	=> (
				if 	ctr < start 
				then	(subh tail start stop (ctr + 1))
				else if ctr > stop 
				then	nil
				else 	head :: (subh tail start stop (ctr+1))
				/if)
		|	else 		=> nil
		/match,
	subh lst start stop 1;
	
index:[lst:[Dynamic] * dex:Int -> Dynamic] <- 
	match lst with
		head::tail	=> (
			if	dex = 0
			then	head
			else 	(index tail (dex - 1))
			/if)
	|	else		=> nil
	/match;

contains:[lst:[Dynamic] * target:Dynamic -> Boolean] <-
	match lst with
		head::tail	=> if head = target then #t else (contains tail target) /if
	|	else		=> #f
	/match;

listsub:[source:[Dynamic] * rem:[Dynamic] -> [Dynamic]] <-
	match source with
		head::tail	=> if (contains rem head) then (listsub tail rem) else (head :: (listsub tail rem)) /if
	|	else		=> nil
	/match;

cons_to_list:[cell:[Dynamic * Dynamic] -> [Dynamic]] <-
	if	(cdr cell) = nil
	then 	(car cell) :: nil
	else 	(car cell) :: (cons_to_list (cdr cell))
	/if;

list_to_cons:[lst:[Dynamic] -> Dynamic] <-
	match* lst with
		head::tail 	=> (cons head (list_to_cons tail))
	|	else 		=> nil
	/match;
